/**
 * * 设置不能访问的时间段
 */

module.exports = () => async (ctx, next) => {
  const currentHour = new Date().getHours()
  if (currentHour >= 0 && currentHour <= 24) {
    await next()
  } else {
    ctx.body = {
      code: 500,
      msg: '当前时段限制访问',
    }
  }
}
